<%@ page import="cc.lucien.web.entity.User" %><%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2021/6/7
  Time: 9:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        a{
            color: #0000ff;
            text-decoration: none;
            cursor: pointer;
        }
        table{
            margin-left: 200px;
        }
        table tr th,table tr td{
            border: 1px solid coral;
            text-align: center;
        }
    </style>
</head>
<body>
    <%
        User user = (User) request.getAttribute("user");
    %>
    <form action="<%=application.getContextPath()%>/web/user.do?method=editUser" method="post">
        <table>
            <caption><h4>修改用户信息表</h4></caption>
            <input type="text" name="id" value="${user.id}" hidden="hidden">
            <tr>
                <td>姓名：</td>
                <td> <input type="text" name="name" value="${user.name}"></td>
            </tr>
            <tr>
                <td>用户名：</td>
                <td> <input type="text" name="username" value="${user.username}"></td>
            </tr>
            <tr>
                <td>密码：</td>
                <td> <input type="text" name="password" value="${user.password}"></td>
            </tr>
            <tr>
                <td>电话：</td>
                <td> <input type="tel" name="phone" value="${user.tel}"></td>
            </tr>
            <tr>
                <td>邮箱：</td>
                <td> <input type="email" name="email" value="${user.email}"></td>
            </tr>
            <tr>
                <td>状态：</td>
                <%
                if (user.getState() == 0){
                %>
                <td>
                    <input type="radio" name="state" value="0" checked="checked">未启用
                    <input type="radio" name="state" value="1">已启用
                </td>
                <%
                } else {
                %>
                <td>
                    <input type="radio" name="state" value="0">未启用
                    <input type="radio" name="state" value="1" checked="checked">已启用
                </td>
                <%
                }
                %>
            </tr>
            <tr>
                <td colspan="5">
                    <input type="submit" value="修改">&nbsp;&nbsp;&nbsp;&nbsp;
                    <button onclick="javascript:window.history.go(-1);return false;">返回</button>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
